package com.river.boot.biz.model.form;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid;
import lombok.Getter;
import lombok.Setter;
import jakarta.validation.constraints.*;

/**
 * 菜品规格表单对象
 *
 * @author JiangCheng Xiang
 * @since 2025-04-25 15:49
 */
@Getter
@Setter
@Schema(description = "菜品规格表单对象")
public class ProductSpecForm implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "菜品规格ID")
    private Long id;

    private Long productId;

    @Schema(description = "规格名称(如:辣度)")
    @NotBlank(message = "规格名称(如:辣度)不能为空")
    @Size(max = 50, message = "规格名称(如:辣度)长度不能超过50个字符")
    private String name;

    @Schema(description = "是否必选")
    private Integer isRequired;

    private Integer sort;

    @Valid
    @Schema(description = "规格选项: 如: 微辣, 中辣, 重辣")
    private List<ProductSpecOptionForm> specOptions;


}
